package com.zhmsky.controller;

import com.zhmsky.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author zhmsky
 * @date 2021/12/2 14:55
 */
@Controller
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping({"/", "/index"})
    public String toIndex() {
        return "index";
    }

    @GetMapping("/user/add")
    public String addUser(){
        return "user/add";
    }

    @GetMapping("/user/delete")
    public String deleteUser(){
        return "user/delete";
    }

    @GetMapping("/ToLogin")
    public String login(){
        return "login";
    }

    @GetMapping("/unauthoriz")
    @ResponseBody
    public String unauthorized(){
       return "您没有访问此页面的权限!";
    }

}
